﻿{layout name="view" /}
<div style="min-height: 700px;">

    {switch name="flog"}
    {case value="tg"}
    <script>
        layui.use('layer', function () { //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            layer.open({
                type: 1
                , title: false //不显示标题栏
                , closeBtn: false
                , area: '300px;'
                , shade: 0.8
                , id: 'LAY_layuipro' //设定一个id，防止重复弹出
                , btn: ['确定']
                , btnAlign: 'c'
                , moveType: 1 //拖拽模式，0或者1
                , content: '<div style="padding: 20px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300; font-size:30px;"><br><br>你已经审核成功<br><br></div>'
                , success: function (layero) {
                    var btn = layero.find('.layui-layer-btn');
                    btn.find('.layui-layer-btn0').attr({
                        href: 'info.html'
                    });
                }
            });
        });
    </script>
    {/case}
    {case value="cz"}
    <script>
        layui.use('layer', function () { //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            layer.open({
                type: 1
                , title: false //不显示标题栏
                , closeBtn: false
                , area: '300px;'
                , shade: 0.8
                , id: 'LAY_layuipro' //设定一个id，防止重复弹出
                , btn: ['确定']
                , btnAlign: 'c'
                , moveType: 1 //拖拽模式，0或者1
                , content: '<div style="padding: 20px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300; font-size:17px; width:300px;"><br><br>你提交的申请正在审核中请稍等...<br><br></div>'
                , success: function (layero) {
                    var btn = layero.find('.layui-layer-btn');
                    btn.find('.layui-layer-btn0').attr({
                        href: 'info.html'
                    });
                }
            });
        });
    </script>
    {/case}
    {case value="pass"}
    <form class="layui-form" action="submissionmsg" name="editForm" method="post" enctype="multipart/form-data">
        <div class="file">
            <div class="layui-form-item" style="margin-left: 100px">
                <a href="javascript:void(0)" class="newspic" style="font-size: 16px; text-decoration: none"> 选择证件照片：
                    <img style="width:200px;height:100px;" src="" alt="" />
                </a>
                <input type="file" id="logoUrl" name="logoUrl" onchange="showPic(this)" value="选择文件"
                    style="display:none" required lay-verify="files|required" />
            </div>
            <div class="layui-form-item" style="margin-left: 100px">
                <a href="javascript:void(0)" class="newspic" style="font-size: 16px; text-decoration: none"> 选择个人寸照：
                    <img style="width:200px;height:100px;" src="" alt="" />
                </a>
                <input type="file" id="logoUrl" name="logoUrl1" onchange="showPic(this)" value="选择文件"
                    style="display:none" required lay-verify="files|required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">名字</label>
            <div class="layui-input-block">
                <input type="text" name="username" required lay-verify="username" placeholder="请输入真实姓名"
                    autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">联系号码</label>
            <div class="layui-input-block">
                <input type="text" name="photo" required lay-verify="required|phone|number" placeholder="请输入电话号码"
                    autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-block">
                <input type="text" name="email" required lay-verify="email" placeholder="请输入邮箱" autocomplete="off"
                    class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">身份证</label>
            <div class="layui-input-block">
                <input type="text" name="cardnumber" required lay-verify="required|identity" placeholder="请输入身份证"
                    autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">地址</label>
            <div class="layui-input-block">
                <select name="city" lay-verify="required">
                    <option value=""></option>
                    <option value="海口">海口</option>
                    <option value="文昌">文昌</option>
                    <option value="琼海">琼海</option>
                    <option value="万宁">万宁</option>
                    <option value="陵水">陵水</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                <input type="radio" name="sex" value="男" title="男">
                <input type="radio" name="sex" value="女" title="女" checked>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">提交申请</label>
            <div class="layui-input-block">
                <textarea name="desc" placeholder="请输入内容" class="layui-textarea" minlength="100"></textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
    <style>
        .file {
            display: flex;
            justify-content: center;
        }

        .layui-form-label {
            float: left;
            display: block;
            padding: 9px 15px;
            width: 88px;
            font-weight: 400;
            line-height: 20px;
            text-align: right;
        }
    </style>
    <script>
        //Demo
        layui.use('form', function () {
            var form = layui.form;
            form.verify({
                username: function (value, item) { //value：表单的值、item：表单的DOM对象
                    if (!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)) {
                        return '用户名不能有特殊字符';
                    }
                    if (/(^\_)|(\__)|(\_+$)/.test(value)) {
                        return '用户名首尾不能出现下划线\'_\'';
                    }
                    if (/^\d+\d+\d$/.test(value)) {
                        return '用户名不能全为数字';
                    }
                },
                files: function (value, item) {
                    if (value == '') {
                        return '文件不能为空';
                    }
                },
            });
        });
        $(".newspic").click(function () {
            $(this).next('input').click();
        });
        function showPic(data) {
            if (data.files && data.files[0]) {
                var reader = new FileReader();
                reader.readAsDataURL(data.files[0]);
                reader.onload = function (evt) {
                    data.parentNode.childNodes[1].childNodes[1].src = evt.target.result;
                }
            }
        }

    </script>
    {/case}
    {default /}default
    {/switch}

</div>